import request from '@/api/request.js'


const api_name = 'NoticeURL'

export default {
    //添加一个notice
    insert(notice) {
        return request({
            url: `/${api_name}/intsert`,
            method: 'post',
            data: notice
        })
    },

    //初始化notice(通知列表),分页

    getNoticesAndPage(object) {
        return request({
            url: `/${api_name}/getNoticesAndPage`,
            method: 'post',
            data: object
        })
    },
    //用户接收到一条通知
    receiveNotice(object) {
        return request({
            url: `/${api_name}/receiveNotice`,
            method: 'post',
            data: object
        })
    },
    //获取该用户发送通告的历史记录
    getNoticesHistory(object){
        return request({
            url: `/${api_name}/getNoticesHistory`,
            method: 'post',
            data: object
        })
    },

    //发送消息给未接受通知的人
    publishNotice(noticeid) {
		return request({
			url: `/${api_name}/publishNotice/${noticeid}`,
			method: 'get',
		})
	},

    //获取上级发送的通知公告
    getSuperiorNotice(object){
        return request({
            url: `/${api_name}/superiorNotice`,
            method: 'post',
            data: object
        })
    },

}
